package com.pand.model.customer;

import com.pand.model.BaseObject;
import com.pand.model.city.City;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * 
 * @ClassName: CustomerBlgCty 
 * @Description: 个人客户信息所属城市信息表
 * @author zzw
 * @date 2016-10-18 下午4:58:17 
 *
 */
@Entity
@Table(name = "BIZ_CUSTOMER_BLGCTY")
@SequenceGenerator(name = "SEQ_BIZ_CUSTOMER_BLGCTY", sequenceName = "SEQ_BIZ_CUSTOMER_BLGCTY", allocationSize = 1)
public class CustomerBlgCty extends BaseObject {
	private Long id;
	private Customer customer;
	private City ownerCity;
	private City registerCity;
	private Timestamp createTime;
	private Timestamp updateTime;
	@Id
	@GeneratedValue(generator = "SEQ_BIZ_CUSTOMER_BLGCTY")
	@Column(name = "ID")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@OneToOne(fetch = FetchType.EAGER,cascade= CascadeType.MERGE)
	@JoinColumn(name = "CST_ID")
	@NotFound(action= NotFoundAction.IGNORE)
	public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	@OneToOne(fetch = FetchType.EAGER,cascade= CascadeType.MERGE)
	@JoinColumn(name = "OWNER_CITY")
	@NotFound(action= NotFoundAction.IGNORE)
	public City getOwnerCity() {
		return ownerCity;
	}
	public void setOwnerCity(City ownerCity) {
		this.ownerCity = ownerCity;
	}
	@OneToOne(fetch = FetchType.EAGER,cascade= CascadeType.MERGE)
	@JoinColumn(name = "REGISTER_CITY")
	@NotFound(action= NotFoundAction.IGNORE)
	public City getRegisterCity() {
		return registerCity;
	}
	public void setRegisterCity(City registerCity) {
		this.registerCity = registerCity;
	}
	@Column(name = "CREATE_IIME")
	public Timestamp getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	@Column(name = "UPDATE_TIME")
	public Timestamp getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}
	 
	
}
